-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Example of VectorSource with a Third Party Tileset #1449
base: master
Are you sure you want to change the base?
Adds Example of VectorSource with a Third Party Tileset #1449
Conversation
lineOpacity: 0.6, | ||
lineColor: "rgb(53, 175, 109)", | ||
lineWidth: 2 | ||
}, | ||
}); | ||
|
||
const VECTOR_SOURCE_URL = | ||
'https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt'; | ||
const TILEJSON_URL = "https://s3.amazonaws.com/tgaw/tilejson.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we'll want to leave this URL in place. That's an object in an S3 bucket that I own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea something we can do is just add a local tilejson file to the example app, so we can pull it off of the devices file system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sweet, didn't realize that could be a local file. I can update the example to use that instead. Also need to update my app to do the same.
This is a great example, we can get it worked into the v7 branch |
@nitaliano so v7 branch is still maintained? ;) |
Yes, I'm working on it again. IDK how much official support this repo will get(most likely none) but I plan to keep helping maintaining it along with others in the community. |
This PR
Adds a new example
ThirdPartyVectorTileSource.js
showing how to useVectorSource
to consume a custom tileset. In #1448 I described an issue I ran into trying to do this. It's not an issue with the library, but I was confused by what I needed to do.The key thing that I missed from the docs was that I needed to use a TileJSON file for the
url
property ofVectorSource
. I was incorrectly trying to use the tile url directly.How to Test
cd example && npm i
npm start
react-native run-ios
The example should show a map centered on Chicago with green lines indicating...I'm not real sure what the data is, but there should be a bunch of green lines.
example screenshot